﻿using Aliyun.OSS;
using Infrastructure.Attribute;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model;
using ZR.Model.Dto.Business.ProductionControl;
using ZR.Model.Models.ProductionControl;
using ZR.Service.IService.ProductionControl;

namespace ZR.Service.Service.ProductionControl
{
    /// <summary>
    /// 三坐标数据追溯参数服务
    /// </summary>
    [AppService(ServiceType = typeof(ICksCMMParameterService), ServiceLifetime = LifeTime.Transient)]
    public class CksCMMParameterService : BaseService<CksCMMInspectionParameter>, ICksCMMParameterService
    {
        public List<CksCMMParamDto> GetList(CksCMMParamQueryDto param)
        {
            var response = Queryable()
                .OrderByDescending(x => x.CreateTime)
                .Where(x => x.BatchCode == param.BatchCode)
                .ToList<CksCMMParamDto>(x => new CksCMMParamDto() { Id = x.Id, Name = x.Name, Value = x.Value });
            return response;
        }
    }
}